<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .father {
      width: 300px;
      height: 300px;
      background-color: antiquewhite;
    }

    .son {
      width: 100px;
      height: 100px;
      background-color: #fff;
    }
  </style>
</head>

<body>
  <h1>
    .self 在父亲上添加 阻止冒泡 <br>
    .stop 在自己上添加 阻止冒泡 <br>
    .prevent 阻止默认事件 <br>
  </h1>
  <div id="app">
    <div class="father" @click.self="father">
      <div class="son" @click="son">
        <!-- <div class="son" @click.stop="son"> -->
        <a href="https//www.baidu.com" @click.prevent>百度</a> <br>
        <a href="https//www.baidu.com" @click.stop.prevent>百度</a>//连写
      </div>
    </div>

  </div>
  <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.7.14/vue.min.js"></script>
  <script>
    var vm = new Vue({
      el: "#app",
      data: {
        msg: 'hello  vue'
      },
      methods: {
        father() {
          alert('father')
        }, son() {
          alert('son')
        }
      },
    })

    // console.log(vm, 2222);
  </script>
</body>

</html>